#ifndef SHAREDTEST_H
#define SHAREDTEST_H

#include "sharedTest_global.h"
#include <iostream>
#include <string.h>
#include <sys/shm.h>
#include <sys/sem.h>

#define Shm_addrees 1209 //共享内存地址标识
using namespace std;

namespace zanxin {

struct SharedData{
    int type;
    double data[6];
};

class SHAREDTEST_EXPORT SharedTest
{
public:
    SharedTest();
    ~SharedTest();
    SharedData GetData();
    int SetData(const SharedData &data);
private:
    void Lock();
    void Unlock();
private:
    SharedData *pShareData_;
    int semId_;
    int shmId_;
};

}// namespace zanxin
#endif // SHAREDTEST_H
